<template>
	<div>
		<vxe-table
      resizable
      row-id="Id"
      border
      :data="value.gridOperation.datalist"
      :tree-config="{children: 'children', accordion: true, line: true}"			
		>
    <vxe-table-column :title="value.gridOperation.treenode.label" :field="value.gridOperation.treenode.prop"  tree-node>
    </vxe-table-column>
    <vxe-table-column v-for="item in value.gridOperation.normalitems" :title="item.label" :field="item.prop"></vxe-table-column>
    <vxe-table-column v-if="value.gridOperation.operationitem.length > 0" title="操作" >
      <template v-slot="{ row }">
      	<vxe-button v-for="item in value.gridOperation.operationitem" type="text"
        size="mini" :text="item.name" @click="itemclick(item.method,row)" >
      		<span  class="font-12 iconfont" :class= "item.icon"></span>{{item.name}}
      	</vxe-button> 
      </template>
    </vxe-table-column>	
	</vxe-table>
	</div>	
</template>
<script>
	export default{
		props: {
			value: {
				type: Object,
				default: {}
			}
		},
		methods: {
			itemclick(method,row) {
				if(typeof(method) === 'function'){
					method(row)
				}
			}
		}
	}
</script>
